function login(){
	var user_tel = document.getElementById("user_tel")
	var user_pwd = document.getElementById("user_pwd")
	var oError = document.getElementById("error_box")
	var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/; 
if(!myreg.test(user_tel.value)) 
{ 
	oError.innerHTML = "请输入有效的手机号码！";
    return false; 
}

	if(user_pwd.value.length > 20 || user_pwd.value.length < 6) {
		oError.innerHTML = "密码请输入6-20位字符"
		isError = false;
		return;
	}
	$.ajax({
		url:"http://114.55.145.243:8080/liantu/LoginServlet",
		data:$("form").serialize(),
		xhrFields: {
			withCredentials: true
		},
		success:function(data){
			if(data.data)
				location.href="index.html"
			else
				oError.innerHTML = "用户名或密码错误";
		},
		dataType:"json"
	})
}
